﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace DGIS.GscloudService.IService
{
    public interface IHttpService
    {
        /// <summary>
        /// POST请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="postDataStr"></param>
        /// <param name="cookieContainer"></param>
        /// <returns></returns>
        string GetHttpWebPostResult(string url, string postDataStr, ref CookieContainer cookieContainer);

        /// <summary>
        /// POST请求(带header参数)
        /// </summary>
        /// <param name="url"></param>
        /// <param name="postDataStr"></param>
        /// <param name="headersDic"></param>
        /// <param name="cookieContainer"></param>
        /// <returns></returns>
        string GetHttpWebPostResult(string url, string postDataStr, Dictionary<string, string> headersDic, ref CookieContainer cookieContainer);

        /// <summary>
        /// GET请求
        /// </summary>
        /// <param name="url"></param>
        /// <param name="cookieContainer"></param>
        /// <returns></returns>
        string GetHttpWebGetReuslt(string url, ref CookieContainer cookieContainer);

        /// <summary>
        /// GET请求，获取返回的实际URL
        /// </summary>
        /// <param name="url"></param>
        /// <param name="cookieContainer"></param>
        /// <returns></returns>
        string GetHttpWebResponseUrl(string url, ref CookieContainer cookieContainer);

        bool DownloadImg(string url, string savePath, ref CookieContainer cookieContainer);
    }
}
